/*
 * Copyright© 2003-2019 浙江汇信科技有限公司, All Rights Reserved.
 */
package com.icinfo.cloud.provider.punish.ucase.casemain.controller;

import com.icinfo.cloud.provider.common.constant.Constant;
import com.icinfo.cloud.provider.punish.ucase.casemain.service.ICasePartiesBranchFlowRecordService;
import com.icinfo.cloud.provider.punish.ucase.casemain.vo.CasePartiesBranchFlowRecordVo;
import com.icinfo.framework.common.web.Result;
import com.icinfo.framework.core.web.BaseController;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 描述：案件当事人分支流程记录前端控制器
 *
 * @author xiangyuyu
 * @date 2022-05-17 14:40
 */
@RestController
@RefreshScope
@RequestMapping("/punish/ucase/case/main/partiesBranchFlow")
@Slf4j
public class CasePartiesBranchFlowRecordController extends BaseController {
    @Resource
    private ICasePartiesBranchFlowRecordService casePartiesBranchFlowRecordService;

    /**
     * 【V2.0.0】描述：获取当事人分支流程信息列表
     *
     * @param caseId 案件id
     * @return {@link Result<List<CasePartiesBranchFlowRecordVo>>} 当事人分支流程信息列表
     * @author xiangyuyu
     * @date 2022-05-17 15:17
     */
    @PostMapping("/getCasePartiesBranchFlowList")
    @ApiOperation(value = "【V2.0.0】描述：获取当事人分支流程信息列表", httpMethod = "POST")
    public Result<List<CasePartiesBranchFlowRecordVo>> getCasePartiesBranchFlowList(@RequestParam(value = "caseId") String caseId) {
        List<CasePartiesBranchFlowRecordVo> list = casePartiesBranchFlowRecordService.getCasePartiesBranchFlowList(caseId);
        return Result.success(Constant.STRING_GET_SUCCESS, list);
    }
}